﻿<Window x:Class="WpfBasicDataBinding.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:myApp="clr-namespace:WpfBasicDataBinding"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <myApp:Data x:Key="myKey" Name="Battula" PhoneNumber="999999"></myApp:Data>
    </Window.Resources>
    <Grid DataContext="{StaticResource myKey}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Column="0" Grid.Row="0">Name</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="1">Phone</TextBlock>
        <TextBox x:Name="txtName" Grid.Column="1" Grid.Row="0" Text="{Binding Path=Name}"></TextBox>
        <TextBox x:Name="txtPhoneNumber" Grid.Column="1" Grid.Row="1" Text="{Binding Path=PhoneNumber}"></TextBox>
        <Button Grid.Column="1" Grid.Row="2" Click="Button_Click">Ok</Button>
    </Grid>
</Window>
